package cn.xiongxf.pet.delay_cancel;

import cn.xiongxf.pet.service.impl.SearchMasterMsgServiceImpl;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic ="pet" ,consumerGroup ="petSearchMasterMsg_consumer_group")
public class Consumer implements RocketMQListener<Long> {
@Autowired
private SearchMasterMsgServiceImpl searchMasterMsgServiceImpl;

    @Override
    public void onMessage(Long id) {
        System.out.println("到时间了，自动拒单！ id="+id);
        searchMasterMsgServiceImpl.reject(id);
    }
}
